package edu.hcmus.sow.dao;

import java.util.List;

import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import edu.hcmus.sow.domain.Client;

/**
 * DAO to manage Client entities.
 * 
 */
@Repository("ClientDAO")
@Transactional
public class ClientDAOImpl extends AbstractHibernateDAO<Client, Integer> implements ClientDAO {
   public List<Client> findByCriteria(String name, String subdomain) throws DataAccessException {
      String query = "from Client c where c.name like ? and c.site.subDomain like ?";
      return executeQuery(query, "%" + name + "%", subdomain + "%");
   }
}
